package com.kczd.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;

import com.kczd.activity.OrderNotDetailActivity;
import com.kczd.adapter.PrivateListingAdapter;
import com.kczd.client.R;
import com.kczd.entity.Location;
import com.kczd.util.ListViewCompat;

import java.util.ArrayList;
import java.util.List;


//未支付订单
public class OrderNotFragment extends Fragment{
	private View view;
	public ListViewCompat lv_yuyue;
	public static List<Location> orderNotlsit = new ArrayList<Location>();


	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		view=inflater.inflate(R.layout.fragment_order_not, null);

		setview();
		return view;
	}

	private void setview() {
		lv_yuyue= (ListViewCompat) view.findViewById(R.id.lv_npaid);
		PrivateListingAdapter mAdapter = new PrivateListingAdapter(getActivity());
		mAdapter.setmMessageItems(orderNotlsit);
		lv_yuyue.setAdapter(mAdapter);
		lv_yuyue.setOnItemClickListener(new AdapterView.OnItemClickListener() {

			@Override
			public void onItemClick(AdapterView<?> parent, View view,
					int position, long id) {
				//新建一个显式意图，第一个参数为当前Activity类对象，第二个参数为你要打开的Activity类
			    Intent intent =new Intent(getActivity(), OrderNotDetailActivity.class);
			    //用Bundle携带数据
			    Bundle bundle=new Bundle();
			    //传递参数
			    bundle.putInt("position", position);
			    intent.putExtras(bundle);
				startActivity(intent);
			}
		});

	}
}
